﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSP.Common.CustomException
{
    public class ExceptionFactory
    {
        /// <summary>
        /// 验证字符串为空异常
        /// </summary>
        /// <param name="str"></param>
        public static void StringNullorEmptyException(string str)
        {
            if (String.IsNullOrEmpty(str))
            {
                throw new Exception("字符串不能为空");
            }
        }
        
        /// <summary>
        /// 验证对象为空异常
        /// </summary>
        /// <param name="obj"></param>
        public static void ObjectNullException(Object obj)
        {
            if (obj == null)
            {
                throw new Exception("对象不能为空");
            }
        }
    }
}
